package com.example.springredirectafterlogin.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
public class BankController {

    @GetMapping(value = "/transfer",produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<Integer> transfer(@RequestParam("accountNo") final Integer accountNo,@RequestParam("amount") final Integer amount){
        log.info("transfer to: {}",accountNo);
        return new ResponseEntity<>(amount, HttpStatus.OK);
    }

    @PostMapping(value = "/transfer")
    @ResponseStatus(HttpStatus.OK)
    public void create(@RequestParam("accountNo") final Integer accountNo,@RequestParam("amount") final Integer amount){
        log.info("transfer to: {}",accountNo);
    }
}
